<%@ Page Language="C#"  AutoEventWireup="false" MasterPageFile="~/default.master" Inherits="MediaMonitor.Login" title="Please Login" ValidateRequest="false" Theme="default" Codebehind="login.aspx.cs" %>

 
 <%@Register TagPrefix ="ctrl" TagName="ForgotPass" Src="~/controls/user-management/forgot-password.ascx" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="Body" Runat="Server">

  
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
        
            <table border="0" cellpadding="5" cellspacing="4" align="center" style="text-align:left">
        <tr valign="top">
            <td align="center">
                <asp:UpdatePanel ID="pnlUpldateLoginx" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table width="100%">
                            <tr>
                                <td>
                                    <h2><asp:literal ID="ltrHeading" runat="server" /></h2>
                                    <asp:Login ID="loginx" runat="server" OnAuthenticate="login_Authenticate">
                                        <LayoutTemplate>
                                            <asp:Panel ID="pnlLoginx" runat="server" DefaultButton="LoginButton">
                                                    <div align="center">
                                                        <center>
                                                        <td>
                                                            <table border="0" cellpadding="2" cellspacing="3" class="Box Highlight" width="300">
                                                                <tr>
                                                                    <td align="center" colspan="2">
                                                                    <br />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td align="right">
                                                                        <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username/Email:</asp:Label>
                                                                    </td>
                                                                    <td align="left">
                                                                        <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" Width="150" Display="Dynamic"
                                                                            ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="loginx">*</asp:RequiredFieldValidator>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td align="right">
                                                                        <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label>
                                                                    </td>
                                                                    <td align="left">
                                                                        <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="128"></asp:TextBox>
                                                                        <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" Display="Dynamic"
                                                                            ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="loginx">*</asp:RequiredFieldValidator>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td></td>
                                                                   <td align="left">
                                                                        <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me next time." Font-Size="Smaller" />
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td align="left" colspan="2" style="color: Red; ">
                                                                    <asp:Label ID="lblErrorMsg" runat="server"></asp:Label>
                                                                     <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                                                                    </td> 
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                    </td>
                                                                    <td align="left">
                                                                        <br />
                                                                         <asp:ImageButton ID="LoginButton" runat="server" SkinID="Login" ValidationGroup="loginx"
                                                                            CommandName="Login" /> 
                                                                            
                                                                            <br /><br />
                                                                            
                                                                            
                                                        
                <div style="float:right; padding-top:4px; display:none;">
                Not already registered? <br />                                                            
                                                                            <asp:HyperLink ID="lnkReg" runat="server" Text=" Register Now" style="cursor:pointer"  />
                                </div>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                            
                                                            </td>
                                                        </center>
                                                    </div>
                                            </asp:Panel>
                                            
                                        </LayoutTemplate>
                                    </asp:Login>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
                
             </td>
        </tr>
    </table>
    
    <br /><br />
    
    <div align="center" style="display:none;">
    <asp:PasswordRecovery ID="pwdRecovery" runat="server" SuccessText="Your password has been sent to your email address">
    <UserNameTemplate>
        <asp:Panel ID="pnlPwd" runat="server" DefaultButton="SubmitButton" EnableViewState="false">
            <center>
                <table border="0" cellpadding="1" cellspacing="5"  align="center" style="text-align:left;" width="300" >
            <tr>
                <td>
                    <table border="0" cellpadding="0" align="center">
                        <tr>
                            <td align="left" colspan="2" class="ErrorText Bold">
                                Forgot Your Password?
                                <br /><br /></td>
                                <td width="80"></td>
                        </tr>
                        <tr>
                            <td align="left" colspan="2">
                                Enter your User Name to receive your password.<br /><br /></td>
                                <td></td>
                        </tr>
                        <tr valign="middle">
                            <td>
                                
                                <asp:Label ID="UserNameLabel"  runat="server" AssociatedControlID="UserName" EnableViewState="false">Username/Email: </asp:Label>
                            </td>
                            <td> 
                                <asp:TextBox ID="UserName" runat="server" EnableViewState="false"  Width="130" ValidationGroup="ctl00@pwdRecovery1"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" EnableViewState="false" 
                                    ControlToValidate="UserName" ErrorMessage="User Name is required." 
                                    ToolTip="User Name is required." ValidationGroup="ctl00$pwdRecovery1">*</asp:RequiredFieldValidator>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td align="center" colspan="3" style="color:Red;">
                                <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
                            </td>
                        </tr>
                        <tr>
                        <td></td>                            
                        <td>
                                <asp:ImageButton ID="SubmitButton" runat="server" CommandName="Submit" 
                                    ValidationGroup="ctl00$pwdRecovery1" SkinID="Submit" EnableViewState="false"   />
                            </td>
                            <td></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
            </center>
            
        </asp:Panel>
    </UserNameTemplate>
</asp:PasswordRecovery>
    </div>
      <asp:SqlDataSource ID="SqlDataSource1" 
        ConnectionString="<%$ ConnectionStrings:DBAdex %>" runat="server" 
        UpdateCommand="update siteuser set IsLoggedIn=1 where siteuserId=@SiteUserID">
   
    </asp:SqlDataSource>

    </ContentTemplate> 
    </asp:UpdatePanel>
    
    
  
</asp:Content>

